package com.cordershy.controller;

import com.cordershy.pojo.pay;
import com.cordershy.service.payService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class payController {
    @Autowired
    payService payService;
    @RequestMapping("/pay/selectByDate")
    public List<pay> selectByDate(@RequestParam(value = "paymonth") String paymonth,@RequestParam(value = "payyear") String payyear,@RequestParam("username") String username){
        return payService.selectByMonth(paymonth, payyear,username);
    }
    @RequestMapping("/pay/addPay")
    public void addPay(pay pay){
        payService.addPay(pay);
    }
    @RequestMapping("/pay/updatePay")
    public void updatePay(pay pay){
        payService.updatePay(pay);
    }
    @RequestMapping("/pay/deletePay")
    public void deletePay(@RequestParam(value = "payid") int payid){
        payService.deletePay(payid);
    }
}
